<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>管理系统 - 登录</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}">
    <link href="{{ url_for('static', filename='css/all.min.css') }}" rel="stylesheet">
    <link href="{{ url_for('static', filename='css/tailwind.css') }}" rel="stylesheet">
</head>
<body class="login-body">
<div class="login-container">
    <div class="login-card">
        <div class="login-header">
            <h2>管理系统</h2>
            <p>请登录您的账户</p>
        </div>
        {% with messages = get_flashed_messages(with_categories=true) %}
            {% if messages %}
                {% for category, message in messages %}
                    <div class="mb-4 p-4 rounded {% if category == 'success' %}bg-green-100 text-green-800{% else %}bg-red-100 text-red-800{% endif %}">
                        {{ message }}
                    </div>
                {% endfor %}
            {% endif %}
        {% endwith %}
        <form id="loginForm" class="login-form" method="POST" action="{{ url_for('admin_login.login') }}">
            {{ form.csrf_token }}
            <div class="form-group">
                <label for="username" class="l-form-label">
                    <i class="fa fa-user"></i>
                </label>
                {{ form.username(class="l-form-input",placeholder="用户名" ) }}
            </div>
            <div class="form-group">
                <label for="password" class="l-form-label">
                    <i class="fa fa-lock"></i>
                </label>
                {{ form.password(class="l-form-input",placeholder="密码" ) }}
            </div>
            {{ form.next_page(type="hidden") }}
            <button type="submit" class="login-button">登录</button>
        </form>
    </div>
</div>

</body>
</html>
